@import "restyle";

$pad-width: 16px;

@include restyle-define(filter-card, (
        restyle-var(horizontal-padding): $pad-width,
        background-color: set-color(white, base),
        padding: restyle-var(horizontal-padding),
        position: relative,
        border-bottom: 1px solid set-color(grey, light)
));

@include restyle-define(filter-rail, (
        list-style-type: none,
        padding: 0,
        border: 1px solid set-color(grey, light)
));

.nacho-filter-rail {
  @include restyle(filter-rail);

  &__header {
    color: set-color(blue, oxford);
    background-color: set-color(white, base);
    padding: $pad-width;
    font-size: 17px;
    font-weight: 600;
  }
}

.nacho-filter-card {
  @include restyle(filter-card);
  max-height: 625px;
  overflow: scroll;

  &:last-child {
    border-bottom: none;
  }

  &__label, .ember-radio-button {
    display: block;
  }

  &__header {
    padding: 0 0 $pad-width/2;
  }

  /// Node link is a filter rail component that navigates to mode details about the
  ///   selected node
  &__node-link {
    display: block;
    margin: 2px 0;
    margin-left: -$pad-width;
    margin-right: -$pad-width;
    padding: $pad-width/2 $pad-width $pad-width/2 $pad-width/2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    &::before {
      content: "+";
      color: set-color(grey, mid);
      padding: 0 10px 0 10px;
    }
  }

  &__node-link + &__node-link {
    border-top: 1px solid set-color(gray, light);
  }
}

// TODO: DSS-6628 ember-radio-button component does not currently support styles
//   on <label> element. There might be a work around:
//   https://github.com/yapplabs/ember-radio-button/issues/13
//   Investigate and find a way to apply a class to the <label> without
//   the override used below
//   Override ember-radio-button styles
.ember-radio-button {
  position: relative;
  left: 26px;
  min-width: 60px;
  cursor: pointer;

  &:before,
  &:after {
    content: " ";
    height: 20px;
    width: 20px;
    position: absolute;
    top: 0;
    left: -26px;
    display: block;
    box-sizing: border-box;
    border-radius: 50%;
  }

  &:before {
    border: 1px solid set_color(grey, mid);
  }

  &:after {
    border: 0 solid set-color(blue, curious);
    transition: border-width 167ms cubic-bezier(0, 0, 0.2, 1);
    border-width: 0px;
  }

  &.checked:after {
    border-width: 6px;
  }

  input[type=radio] {
    opacity: 0;
    margin: 16px 2px 0 0;
    position: absolute;
  }
}
